﻿<%@ Page Language="C#" EnableEventValidation="false"  AutoEventWireup="true" CodeFile="SetSellManager.aspx.cs" Inherits="admin_SetSellManager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>

                        <link rel="Stylesheet" type="text/css" href="../Styles/right_style.css" />
                <script type="text/javascript" src="../Scripts/jquery.ui/js/jquery.js"></script>

                <style type="text/css">
                <!--
                html{ scrollbar-base-color: #dbecf8; scrollbar-arrow-color: #2a8ed1; scrollbar-track-color: #bdddf2; scrollbar-3dlight-color: #2886c5; scrollbar-darkshadow-color: #2886c5;
                scrollbar-face-color: #dbecf8; scrollbar-shadow-color: #dbecf8;  }
                -->
                </style>

</head>
<body>
    <form id="form1" runat="server">
            <div class="sub_right_top">
  <div class="hdm_header" >
    <div class="tb1_on"><h2 class="h2_icon">销售主管指派</h2></div>

    <div class="clear"></div>
  </div>
  <div class="hdm_footer">
  <div style="height:13px; overflow:hidden;"></div>
    <form id="form2" name="form1" method="post" action="">
      <table width="96%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#77acd0" style="border-collapse:collapse; ">
        <tr bgcolor="#b1d5ef">
          <td><div class="com_zdzg_word">指定销售主管</div><div class="com_zdzg_list">
          <asp:DropDownList ID="ddlSelectType" runat="server" AutoPostBack="True" 
                  OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" Height="20px" 
                  Width="134px">
                        <asp:ListItem Value="0">按部门选择人员</asp:ListItem>
                        <asp:ListItem Value="1">按角色选择人员</asp:ListItem>
                    </asp:DropDownList>
          </div><div class="com_zdzg_wordsm">销售主管可以查询、管理全部客户记录和销售记录</div></td>
        </tr>
        <tr>

          <td align="center"><table width="480" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin:10px 0;">
            <tr>
              <td width="230" align="center">销售主管</td>
              <td width="20">&nbsp;</td>
              <td width="230" align="center">备选人员</td>
            </tr>
            <tr>
              <td width="230" align="center">
                <asp:ListBox ID="lbSellManager" runat="server" Height="250px" Width="150px" SelectionMode="Multiple"></asp:ListBox>
                </td>
              <td width="20"><p>
               <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/to_1l.gif" OnClientClick="addOption();return false;" />
              </p>
                <p>&nbsp;</p>
                <p>
                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/to_1r.gif" OnClientClick="delOption();return false;" />
                </p></td>

              <td width="230" align="center">
                <asp:ListBox ID="lbSellUser" runat="server" Height="250px" Width="150px" SelectionMode="Multiple" Font-Size="12px"></asp:ListBox>
              </td>
            </tr>
            <tr>
              <td width="230" align="center">
                    <asp:Button ID="Button1" runat="server" Text="" OnClientClick="selectAll('lbSellManager');return false;" CssClass="com_all_button"/>
                  </td>
              <td width="20">&nbsp;</td>
              <td width="230" align="center">
                <asp:Button ID="Button4" runat="server" Text="" OnClientClick="selectAll('lbSellUser');return false;" CssClass="com_all_button"/>
                 </td>
            </tr>
            <tr>
              <td colspan="3" align="center">
                <asp:Button ID="Button2" runat="server" Text="" CssClass="queding_anniu" OnClick="Button3_Click" OnClientClick="selectAll('lbSellManager');selectAll('lbSellUser');"  />
                 </td>
              </tr>
          </table></td>
        </tr>

      </table>      
    </form>
    <div style="height:15px; overflow:hidden;"></div>
  </div>
</div>

    </form>
</body>
</html>
<script language="javascript" type="text/javascript">
var item=document.getElementById('lbSellUser');
var setitem=document.getElementById('lbSellManager');
function addOption()
{
    var arrayValue=new Array();
    for(var i=0;i<item.length;i++)
    {
        if(item.options[i].selected)
        {
            var opt=new Option(item.options[i].text,item.options[i].value);
            setitem.options[setitem.length]=opt;
            arrayValue.push(item.options[i].value);
        }
    }
    for(var i=0;i<arrayValue.length;i++)
    {
        for(var j=0;j<item.length;j++)
        {
            if(item.options[j].value==arrayValue[i])
            {
                item.options[j]=null;
            }
        }
    }
}
function delOption()
{
    var arrayValue=new Array();
    for(var i=0;i<setitem.length;i++)
    {
        if(setitem.options[i].selected)
        {
            var opt=new Option(setitem.options[i].text,setitem.options[i].value);
            item.options[item.length]=opt;
            arrayValue.push(setitem.options[i].value);
        }
    }
    for(var i=0;i<arrayValue.length;i++)
    {
        for(var j=0;j<setitem.length;j++)
        {
            if(setitem.options[j].value==arrayValue[i])
            {
                setitem.options[j]=null;
            }
        }
    }
}
function selectAll(items)
{
    var itemss= document.getElementById(items);
    for(var i=0;i<itemss.options.length;i++)
    {
        itemss.options[i].selected=true;
    }
}
</script>